//
// Created by Tony on 2024/7/2.
//

#ifndef PARSER_FIELD_DEFINE_H
#define PARSER_FIELD_DEFINE_H

#include "../../AstList.h"
#include "../AccessFlags.h"
#include "../TypeTag.h"

namespace Parser {

class FieldDefine final : public AstList {
    string nodeName;
    Compiler::Location location;
    Compiler::Symbol mSymbol;

public:
    explicit FieldDefine(const vector<shared_ptr<Ast>>& children) : AstList(children) {
        nodeName = __func__;
    }

    shared_ptr<AccessFlags> getAccessFlags();

    string getName();

    shared_ptr<TypeTag> getTypeTag();

    shared_ptr<Ast> getInitExpr();

    void setLocation(const Compiler::Location& loc) { this->location = loc; }

    void setSymbol(Compiler::Symbol symbol) { mSymbol = symbol; }

    Compiler::Symbol getSymbol() { return mSymbol; }

    int32_t accept(Compiler::Visitor* visitor) override;
};

} // namespace Parser

#endif // PARSER_FIELD_DEFINE_H
